package com.why.simpleboot.core.core.entity;

import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Map;

/**
 * @program: why-simpleboot
 * @description:
 * @author: @why
 * @create: 2021-05-15 15:40
 **/
public class MethodDefinition implements Serializable {
    /**
     * 将method封装，每个方法所需要的参数和数据等等等都封装在这里面
     */

    /**
     * 方法
     */
    private transient Method method;
    /**
     * 每个方法对应的路径变量                @PathVariable
     */
    private Map<String, String> pathVariableParameterMappings;
    /**
     * 每个方法对应的路径参数                @RequestParam
     */
    private Map<String, String> requestParameterMappings;
    /**
     * 方法中的json数据                     @ResponseBody
     */
    private String json;
    public MethodDefinition() {
    }

    public MethodDefinition(Method method, Map<String, String> pathVariableParameterMappings,
                            Map<String, String> requestParameterMappings, String json) {
        this.method = method;
        this.pathVariableParameterMappings = pathVariableParameterMappings;
        this.requestParameterMappings = requestParameterMappings;
        this.json = json;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public Map<String, String> getPathVariableParameterMappings() {
        return pathVariableParameterMappings;
    }

    public void setPathVariableParameterMappings(Map<String, String> pathVariableParameterMappings) {
        this.pathVariableParameterMappings = pathVariableParameterMappings;
    }

    public Map<String, String> getRequestParameterMappings() {
        return requestParameterMappings;
    }

    public void setRequestParameterMappings(Map<String, String> requestParameterMappings) {
        this.requestParameterMappings = requestParameterMappings;
    }

    public String getJson() {
        return json;
    }

    public void setJson(String json) {
        this.json = json;
    }
}
